package com.fzkj.queue;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;

/**
 * @DESCRIPTION 同步队列，队列中只能存放一个
 */
public class SynchronousQueueDemo {

    // 多线程环境下好像才能看到效果
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<Integer> queue = new SynchronousQueue<>();
        queue.put(1);
        queue.take();
    }
}
